package com.zjs.environment;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 环境测试
 *
 * @author zhu_jinsheng
 * @version 1.0
 * @date 2020/8/18 17:05
 */
@Slf4j
@RestController
@RequestMapping("/environment")
@Api(description = "运行环境信息")
public class EnvironmentController {

    @Value("${environment.name}")
    private String currentEnvironment;

    @ApiOperation(value = "获取当前系统运行环境")
    @PostMapping("/getCurrentEnvironment")
    public String getCurrentEnvironment() {
        log.info("系统当前运行环境：{}", currentEnvironment);
        return "当前运行环境：" + currentEnvironment;
    }
}
